package com.link2room.aeriabots.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by Nakisa on 2016/10/9.
 */
@Entity
@Table(name = "wx_qrcode")
@DynamicInsert
public class WxQrcode extends BaseEntity {
    private String qrType;
    private String qrkey;
    private String ticket;
    private String url;
    private Integer sceneId;
    private String remark;
    @Basic
    @Column(name = "scene_id", nullable = true)
    public Integer getSceneId() {
        return sceneId;
    }

    public void setSceneId(Integer sceneId) {
        this.sceneId = sceneId;
    }

    @Basic
    @Column(name = "qr_key", nullable = true, length = 32)
    public String getQrkey() {
        return qrkey;
    }

    public void setQrkey(String qrkey) {
        this.qrkey = qrkey;
    }



    @Basic
    @Column(name = "qr_type", nullable = true, length = 32)
    public String getQrType() {
        return qrType;
    }

    public void setQrType(String qrType) {
        this.qrType = qrType;
    }

    @Basic
    @Column(name = "ticket", nullable = true, length = 128)
    public String getTicket() {
        return ticket;
    }

    public void setTicket(String ticket) {
        this.ticket = ticket;
    }

    @Basic
    @Column(name = "url", nullable = true, length = 64)
    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }
    @Basic
    @Column(name = "remark", nullable = true, length = 32)
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        WxQrcode wxQrcode = (WxQrcode) o;

        if (qrType != null ? !qrType.equals(wxQrcode.qrType) : wxQrcode.qrType != null) return false;
        if (sceneId != null ? !sceneId.equals(wxQrcode.sceneId) : wxQrcode.sceneId != null) return false;
        if (qrkey != null ? !qrkey.equals(wxQrcode.qrkey) : wxQrcode.qrkey != null) return false;
        if (ticket != null ? !ticket.equals(wxQrcode.ticket) : wxQrcode.ticket != null) return false;
        if (url != null ? !url.equals(wxQrcode.url) : wxQrcode.url != null) return false;
        if (remark != null ? !remark.equals(wxQrcode.remark) : wxQrcode.remark != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = qrkey != null ? qrkey.hashCode() : 0;
        result = 31 * result + (qrType != null ? qrType.hashCode() : 0);
        result = 31 * result + (sceneId != null ? sceneId.hashCode() : 0);
        result = 31 * result + (ticket != null ? ticket.hashCode() : 0);
        result = 31 * result + (url != null ? url.hashCode() : 0);
        result = 31 * result + (remark != null ? remark.hashCode() : 0);
        return result;
    }
}
